<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/financier.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateVirementTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form>
                <h:panelGrid columns="3">
                    <h:outputLabel value="#{bundle.CreateVirementLabel_nomVirement}" for="nomVirement" />
                    <p:inputText id="nomVirement" required="true" value="#{virementController.selected.nomVirement}" title="#{bundle.CreateVirementTitle_nomVirement}" />
                    <p:message for="nomVirement"/>
                    <h:outputLabel value="#{bundle.CreateVirementLabel_montant}" for="montant" />
                    <p:inputText id="montant" required="true" value="#{virementController.selected.montant}" title="#{bundle.CreateVirementTitle_montant}" />
                    <p:message for="montant"/>
                    <h:outputLabel value="#{bundle.CreateVirementLabel_dateVirement}" for="dateVirement" />
                    <p:calendar id="dateVirement" value="#{virementController.selected.dateVirement}" pattern="dd/MM/yyyy" title="#{bundle.CreateVirementTitle_dateVirement}" >
                        <f:convertDateTime pattern="dd/MM/yyyy" />
                    </p:calendar>
                    <p:message for="dateVirement"/>
                    <h:outputLabel value="#{bundle.CreateVirementLabel_description}" for="description" />
                    <p:inputText id="description" value="#{virementController.selected.description}" title="#{bundle.CreateVirementTitle_description}" />
                    <p:message for="description"/>
                    <h:outputLabel value="#{bundle.CreateVirementLabel_credit}" for="credit" />
                    <p:selectOneMenu id="credit" value="#{virementController.selected.credit}" title="#{bundle.CreateVirementTitle_credit}" >
                        <f:selectItems value="#{mouvementController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>
                    <p:message for="credit"/>
                    <h:outputLabel value="#{bundle.CreateVirementLabel_debit}" for="debit" />
                    <p:selectOneMenu id="debit" value="#{virementController.selected.debit}" title="#{bundle.CreateVirementTitle_debit}" >
                        <f:selectItems value="#{mouvementController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>
                    <p:message for="debit"/>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{virementController.create}" value="#{bundle.CreateVirementSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{virementController.prepareList}" value="#{bundle.CreateVirementShowAllLink}" immediate="true"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
